﻿<Selection:jSLGrid x:Class="jSLApp.Client.Controls.TopicGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection;assembly=jSLCore.Client.Presentation" 
                          xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
                          xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" xmlns:Converters="clr-namespace:jSLApp.Client.Converters" 
                          IsReadOnly="True"
                          ShowDetailsClicked="goDetails_Clicked">
    <Selection:jSLGrid.Resources>
        <ResourceDictionary Source="../Resources/UndergroundStyle.xaml"/>
    </Selection:jSLGrid.Resources>
        <Selection:jSLGrid.Columns>
        <tk:DataGridTemplateColumn Header="Тип" CanUserReorder="False" CanUserResize="False">
            <tk:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Image Width="16" Height="16" Margin="0">
                        <ToolTipService.ToolTip>
                            <Binding Path="TypeEnum">
                                <Binding.Converter>
                                    <Converters:CommentableTypeToTooltipConverter/>
                                </Binding.Converter>
                            </Binding>
                        </ToolTipService.ToolTip>
                        <Image.Source>
                            <Binding Path="TypeEnum">
                                <Binding.Converter>
                                    <Converters:CommentableTypeToImageConverter/>
                                </Binding.Converter>
                            </Binding>
                        </Image.Source>
                    </Image>
                </DataTemplate>
            </tk:DataGridTemplateColumn.CellTemplate>
        </tk:DataGridTemplateColumn>
        <Selection:DataGridGoDetailsColumn Header="Название" Binding="{Binding Name}"/>
        <tk:DataGridTextColumn Header="Автор" Binding="{Binding CreatorNameTxt}"/>
        <tk:DataGridTextColumn Header="Время создания">
            <tk:DataGridTextColumn.Binding>
                <jBinding:jBinding Path="CreationDate" ConvertingMode="ToShortDateAndTime"/>
            </tk:DataGridTextColumn.Binding>
        </tk:DataGridTextColumn>
        <tk:DataGridTextColumn Header="Последнее сообщение" Binding="{Binding LastMessageInfo}"/>
    </Selection:jSLGrid.Columns>
</Selection:jSLGrid>
